package org.facyt.vacas.view.formulacion.field;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.facyt.commons.util.VaadinUtil;
import org.facyt.commons.view.field.BaseComboBox;
import org.facyt.vacas.view.formulacion.TipoAnimalEnum;
import org.facyt.vacas.view.formulacion.bean.TipoAnimalBean;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class TipoAnimalComboBox extends BaseComboBox<TipoAnimalBean> {

	private static final long serialVersionUID = -1792094842590047908L;

	public TipoAnimalComboBox() {
	    super(VaadinUtil.getProperties("combobox.default.value"));
	}
	
	public TipoAnimalComboBox(String caption, String captionNullSelection) {
		super(caption, VaadinUtil.getProperties("combobox.default.value"));

	}

	@Override
	protected Object getItemCaptionProperty() {
		return "descripcion";
	}

	@Override
	protected Collection<? extends TipoAnimalBean> getItems() {
		List<TipoAnimalBean> lista = new ArrayList<TipoAnimalBean>();
		
		lista.add(new TipoAnimalBean(TipoAnimalEnum.VACA_SECA));
		lista.add(new TipoAnimalBean(TipoAnimalEnum.VACA_ORDENIE));
		lista.add(new TipoAnimalBean(TipoAnimalEnum.VACA_CRIA));
		
		return lista;
	}

}
